﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace ABELGX
{
    /// <summary>
    /// PageCar.xaml 的交互逻辑
    /// </summary>
    public partial class PageCar : Page
    {
        public Car Car { get; private set; }
        public PageCar()
        {
            InitializeComponent();
        }
        public void SetCar(Car car)
        {
            Car = car;
            if (Car == null)
            {
                return;
            }
            new SwitchVM(MainLight, Car.CmdCommon.MainLight, Car.InfoCommon.MainLight);
            new SwitchVM(Warning, Car.CmdCommon.Warning, Car.InfoCommon.Warning);
            new SwitchVM(Spray, Car.CmdCommon.Spray, Car.InfoCommon.Spray);
            new SwitchVM(Avoidance, Car.CmdCommon.Avoidance, Car.InfoCommon.Avoidance);
            new SwitchVM(Custom7, Car.CmdCommon.Customize[6], Car.InfoCommon.Customize[6]);
            new SwitchVM(Custom8, Car.CmdCommon.Customize[7], Car.InfoCommon.Customize[7]);
            new SwitchVM(Custom9, Car.CmdCommon.Customize[8], Car.InfoCommon.Customize[8]);

        }
    }
}
